#ifndef VIDEO_CONVERT_H
#define VIDEO_CONVERT_H
#include "AV_Common.h"

extern "C"
{
#include "libswscale/swscale.h"
}
class Video_Convert
{
public:
    Video_Convert();
    ~Video_Convert();
public:
    bool Open(int32_t in_width,int32_t in_height,AVPixelFormat in_fmt,
              int32_t out_width,int32_t out_height,AVPixelFormat out_fmt);
    void Close();
    int32_t Convret(AVFramePtr in_frame,AVFramePtr& out_frame);
    private:
    int32_t width_;
        int32_t height_;
    AVPixelFormat fmt_;
    SwsContext* swsContext_ = nullptr;
};

#endif // VIDEO_CONVERT_H
